package com.ssy.lingxi.order.model.vo.basic.request;

import com.ssy.lingxi.order.handler.annotation.DateTimeFormatAnnotation;
import com.ssy.lingxi.order.model.vo.common.request.LogisticsAddressVO;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * @author wyx
 * @version 2.0.0
 * @date 2021-10-13
 */
@Setter
@Getter
public class ReceiveOrderCreateVO implements Serializable {

    private static final long serialVersionUID = 6601360564597651659L;
    /**
     * 发货单id
     */
    @NotNull(message = "发货单id不能为空！")
    private Long deliveryOrderId;
    /**
     * 摘要
     */
    @NotBlank(message = "摘要不能为空！")
    @Size(max = 100, message = "摘要最长100个字符！")
    private String digest;

    /**
     * 收货时间 yyyy-MM-dd HH:mm:ss
     */
    @DateTimeFormatAnnotation(message = "收货时间格式错误！")
    private String receiveTime;

    /**
     * 收货商品集合
     */
    @Valid
    @NotEmpty(message = "物料/商品列表不能为空")
    @Size(min = 1,message ="送货单物料/商品信息不能为空！" )
    private List<ReceiveOrderProductParamVO> products;

    /**
     * 备注
     */
    @Size(max = 150, message = "备注最长150个字符！")
    private String remark;

    /**
     * 收货人
     */
    @Valid
    private LogisticsAddressVO executorVO;

}
